<template>
  <div class="portal">
    <navigation-bar></navigation-bar>
    <el-container>
      <!--    侧边栏-->
      <el-aside width="188px">
        <div class="title">门户管理</div>
        <el-menu
          :default-active="activePath"
          class="el-menu-vertical-demo"
          router>
          <el-menu-item index="/portal/article">
            <i class="el-icon-menu"></i>
            <span slot="title">文章管理</span>
          </el-menu-item>
          <el-menu-item index="/portal/evaluation">
            <i class="el-icon-menu"></i>
            <span slot="title">服务评价管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <!--    主要内容-->
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import NavigationBar from "@/components/NavigationBar";
export default {
  name: "Portal",
  components: {NavigationBar},
  data(){
    return{
      activePath: '/portal/article'
    }
  },
  watch:{
    $route(to,from){
      this.activePath = to.path;
    }
  }
}
</script>

<style scoped>
.portal{
  height: 100%;
}
.el-container{
  height: calc(100% - 50px);
}
.el-menu{
  height: calc(100% - 40px);
}
.title{
  text-align: center;
  height: 40px;
  line-height: 40px;
  font-size: 16px;
  font-weight: bold;
  background-color: rgb(55,75,118);
  /*margin-bottom: 10px;*/
  color: white;
}
</style>
